﻿using BarManager.Core.BusinessRules.Interfaces.Specification;
using BarManager.Core.DomainService;
using System.Collections.Generic;

namespace BarManager.Core.BusinessRules.Specification
{
    public abstract class BaseSpecification<TEntity> : ISpecification<TEntity> where TEntity : class
    {
        protected TEntity Entity { get; set; }
        protected IRepository<TEntity> BaseRepository { get; private set; }
        public BaseSpecification(IRepository<TEntity> repository)
        {
            this.BaseRepository = repository;
        }
        public abstract bool IsSatisfiedBy(TEntity entity);
        public abstract IEnumerable<string> GetErrorMessage();
    }
}
